package cn.hf.mychat.Study;

import cn.hf.mychat.MychatApplication;
import cn.hf.mychat.config.ConfigurationTest;
import cn.hf.mychat.config.ConfigurationTest1;
import lombok.RequiredArgsConstructor;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.test.context.junit4.SpringRunner;

//@EnableConfigurationProperties(value = ConfigurationTest.class)

@RunWith(SpringRunner.class)
@SpringBootTest(classes = MychatApplication.class)
@EnableConfigurationProperties(value = {ConfigurationTest1.class})
public class ConfigTest {

    @Autowired
    private ConfigurationTest1 configurationTest1;


    @Test
    public void test(){
        String name = configurationTest1.getName();
        Integer password = configurationTest1.getPassword();
        System.out.println(name+password);
    }


}

